import 'package:flutter/material.dart';

import 'package:bloc_pattern/bloc_pattern.dart';

import 'package:xxx_app/src/blocs/increment/increment_bloc.dart';


class OrderScreen extends StatefulWidget {
  @override
  _OrderScreenState createState() => _OrderScreenState();

}

class _OrderScreenState extends State<OrderScreen> {
  
  @override
  Widget build(BuildContext context) {
    final IncrementBloc incrementBloc =BlocProviderList.of<IncrementBloc>(context);

    var scaffold =Scaffold(
      appBar: AppBar(
        title: Text(
          "订单"
        ),
      ),
      body: Container(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Container(
                child: Center(
                   child: Image.asset("assets/images/common/app_logo.png"),
                ),
              ),
              StreamBuilder(
                stream: incrementBloc.outScreen ,
                initialData: 4,
                builder: (BuildContext context, AsyncSnapshot snapshot){
                  return Text("点击次数 ${snapshot.data} vezes", );
                },
              ),

              Text(
                  "Order",
                  style:TextStyle(
                    fontSize: 32
                  )
              )

            ],



          ),
        ),
      ),
    );
    return scaffold;

  }
}